package src.main;

import main.Strategy;

import java.lang.reflect.Constructor;
import java.util.concurrent.CompletionStage;
import java.util.function.Consumer;

public class Context {
    public static void showPromotions(Class<? extends Strategy> clazz, Consumer<Strategy> strategyConsumer){
        try {
            Constructor<? extends Strategy> declaredConstructor = clazz.getDeclaredConstructor();
            declaredConstructor.setAccessible(true);
            Strategy strategy = declaredConstructor.newInstance();
            strategyConsumer.accept(strategy);
        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
